<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ page import="java.util.List" %>
<%@ page import="javax.jdo.PersistenceManager" %>
<%@ page import="javax.jdo.Query" %>
<%@ page import="jp.ac.segakuen.SelectListTable" %>
<%@ page import="jp.ac.segakuen.SelectListTableUtils" %>
<%@ page import="jp.ac.segakuen.PMF" %>


<html>
<body>
<%
	PersistenceManager pm = PMF.get().getPersistenceManager();
	String query = "";

	query = "select from jp.ac.segakuen.SelectListTable where displayPlaceHolder == 'taiken' order by sortOrder asc";
 %>

	<H2>[体験教室日程]<p>登録されている選択情報</H2><p>
<%
	Query qr = pm.newQuery(query);
	List<SelectListTable> selectlist = (List<SelectListTable>) qr.execute();
    if (selectlist.isEmpty()) {
%>
<p>登録されているデータはありません</p>
<% }else{ %>
<table border=4>
<TR>
<TH>表示順</TH><TH>表示内容</TH><th>削除</th>
</TR>
<%
        for (SelectListTable l : selectlist) {
%>
<TR>
<td><%= l.getStringSortOrder() %></td>
<td><%= l.getListText() %></td>
<td><form action="/selectlisttableservlet" method="post">
<input type ="hidden" name="placeholder" value="taiken">
<input type ="hidden" name="delid" value=<%=l.getStringId()%>>
<input type="submit" name="submit" value="削除"></form></td>
</TR>
<% } %>
</table>
<%        
    }
    pm.close();
%>
<h2>表示データの追加登録:</h2>
<form action="/selectlisttableservlet" method="post">
	<p>追加項目:<input type ="hidden" name="placeholder" value="taiken">体験教室日程

<p>表示順（半角文字）:
	<input name="sortorder" value=""></p>
<p>表示内容（全角文字も可）:
	<input name="listtext" value=""></p>	
	<input type="submit" name="submit" value="Add">
	</p>

</form>

</body>
</html>
